},
_updateVisibility: function() {
- if (!this._haveSuspend && !this._haveShutdown && !this._haveRestart)
- this.actor.hide();
- else
- this.actor.show();
+ let shouldBeVisible = (this._haveSuspend || this._haveShutdown || this._haveRestart);
+ this.actor.visible = shouldBeVisible;
},
_updateHaveShutdown: function() {
else
this._haveShutdown = false;
- if (this._haveShutdown)
- this._powerOffItem.actor.show();
- else
- this._powerOffItem.actor.hide();
-
+ this._powerOffItem.actor.visible = this._haveShutdown;
this._updateVisibility();
}));
} else {
else
this._haveShutdown = false;
- if (this._haveShutdown) {
- this._powerOffItem.actor.show();
- } else {
- this._powerOffItem.actor.hide();
- }
-
+ this._powerOffItem.actor.visible = this._haveShutdown;
this._updateVisibility();
}));
}
else
this._haveRestart = false;
- if (this._haveRestart)
- this._restartItem.actor.show();
- else
- this._restartItem.actor.hide();
-
+ this._restartItem.actor.visible = this._haveRestart;
this._updateVisibility();
}));
} else {
else
this._haveRestart = false;
- if (this._haveRestart) {
- this._restartItem.actor.show();
- } else {
- this._restartItem.actor.hide();
- }
-
+ this._restartItem.actor.visible = this._haveRestart;
this._updateVisibility();
}));
}
_updateHaveSuspend: function() {
this._haveSuspend = this._upClient.get_can_suspend();
-
- if (this._haveSuspend)
- this._suspendItem.actor.show();
- else
- this._suspendItem.actor.hide();
-
+ this._suspendItem.actor.visible = this._haveSuspend;
this._updateVisibility();
},
crosshairsActor = new Clutter.Clone({ source: this._actor });
this._clones.push(crosshairsActor);
}
- if (this._actor.visible)
- crosshairsActor.show();
- else
- crosshairsActor.hide();
+ crosshairsActor.visible = this._actor.visible;
container.add_actor(crosshairsActor);
container.raise_child(magnifiedMouse, crosshairsActor);
/* TRANSLATORS: this means that bluetooth was disabled by hardware rfkill */
this._killswitch.setStatus(_("hardware disabled"));
- if (has_adapter)
- this.actor.show();
- else
- this.actor.hide();
+ this.actor.visible = has_adapter;
if (on) {
this._discoverable.actor.show();
// the device
// we can do it here because addConnection and removeConnection
// both call _createSection at some point
- if (this._connections.length <= 1)
- this.section.actor.hide();
- else
- this.section.actor.show();
+ this.section.actor.visible = this._connections.length <= 1;
},
_createAutomaticConnection: function() {
},
setEnabled: function(enabled) {
- if (enabled) {
- this.statusItem.actor.show();
- this.section.actor.show();
- } else {
- this.statusItem.actor.hide();
- this.section.actor.hide();
- }
+ this.statusItem.actor.visible = enabled;
+ this.section.actor.visible = enabled;
},
activate: function() {
}
}
}
- if (showInput) {
- this._inputTitle.actor.show();
- this._inputSlider.actor.show();
- } else {
- this._inputTitle.actor.hide();
- this._inputSlider.actor.hide();
- }
+
+ this._inputTitle.actor.visible = showInput;
+ this._inputSlider.actor.visible = showInput;
},
_volumeToIcon: function(volume) {
_updateLogout: function() {
let allowLogout = !this._lockdownSettings.get_boolean(DISABLE_LOG_OUT_KEY);
- if (allowLogout)
- this._logoutItem.actor.show();
- else
- this._logoutItem.actor.hide();
+ this._logoutItem.actor.visible = allowLogout;
},
_updateLockScreen: function() {
let allowLockScreen = !this._lockdownSettings.get_boolean(DISABLE_LOCK_SCREEN_KEY);
- if (allowLockScreen)
- this._lockScreenItem.actor.show();
- else
- this._lockScreenItem.actor.hide();
+ this._logoutItem.actor.visible = allowLockScreen;
},
_updateHaveShutdown: function() {
if (!this._suspendOrPowerOffItem)
return;
- if (!this._haveShutdown && !this._haveSuspend)
- this._suspendOrPowerOffItem.actor.hide();
- else
- this._suspendOrPowerOffItem.actor.show();
+ this._suspendOrPowerOffItem.actor.visible = this._haveShutdown || this._haveSuspend;
// If we can't suspend show Power Off... instead
// and disable the alt key
if (!primaryView)
return;
primaryView.actor.opacity = opacity;
- if (opacity == 0)
- primaryView.actor.hide();
- else
- primaryView.actor.show();
+ primaryView.actor.visible = opacity != 0;
}));
}));
},